clear all;
close all;
A=imread('lena.bmp');
A=double(A);
[row,col]=size(A);
% Calculate the mean of the image
b=sum(A(:));
display(b);
mean=(sum(A(:))/(row*col));
display(mean);
% Calculate the variance and standard deviation of the image
diff=(A-mean).^2;
sum=sum(diff(:));
var=sum/((row*col)-1);
display(var);
standarddev=sqrt(var);
display(standarddev);
% Calculate the median of the image
R=reshape(A,[],1);
min1=min(R);
max1=max(R);
S=sort(A(:));
num=round((row*col)/2);
 
if((mod(row,2)==0) || (mod(col,2)==0) )
    median=(S(num)+S(num+1))/2;
else
    median=S(num);
end
display(median);
